package com.xsomnus.network_programming.netty.udpchat;

import com.xsomnus.network_programming.netty.udpchat.config.UDPUtils;


public class EchoClient {
    public static void main(String[] args) throws Exception {

        LocalUDPSocketProvider.getInstance().initSocket();

        LocalUDPReceiver.getInstance().startup();


        while (true) {

            String toServer = "Hi" + System.currentTimeMillis();
            byte[] soServerBytes = toServer.getBytes("UTF-8");

            boolean ok = UDPUtils.send(soServerBytes, soServerBytes.length);
            if (ok)
                System.out.println("EchoClient�");
            else
                System.out.println("EchoClient");
            Thread.sleep(3000);
        }
    }
}
